//
//  BKIntegralHeaderView.m
//  bestkeep
//
//  Created by yons on 16/12/5.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import "BKIntegralHeaderView.h"
#import "BKMainCommon.h"
#import "BKIntegralCommon.h"
#import "BKIntegralListViewController.h"

@interface BKIntegralHeaderView()

#pragma mark-泡泡组
@property (nonatomic,strong)BKBubbleView *cuteView_1;//左上角的泡泡
@property (nonatomic,strong)BKBubbleView *cuteView_2;//左下角的泡泡
@property (nonatomic,strong)BKBubbleView *cuteView_3;//右上角的泡泡
@property (nonatomic,strong)BKBubbleView *cuteView_4;//右下角的泡泡

#pragma mark-背景视图
@property (nonatomic,strong)UIImageView *imgV_up;//上面的紫色视图
@property (nonatomic,strong)UIImageView *imgV_down;//下面的白色视图

#pragma mark-七天的日期圈圈
@property (nonatomic,strong)BKCicleView* signCicle_1;
@property (nonatomic,strong)BKCicleView* signCicle_2;
@property (nonatomic,strong)BKCicleView* signCicle_4;
@property (nonatomic,strong)BKCicleView* signCicle_5;
@property (nonatomic,strong)BKCicleView* signCicle_6;
@property (nonatomic,strong)BKCicleView* signCicle_7;

@property (nonatomic,strong) BKintegralModel * model;//Model
@end

@implementation BKIntegralHeaderView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initViews];
        self.backgroundColor = RGB(241, 242, 243);
        [self create_CircleS];
        [self create_bubbleS];
    }
    return self;
}


+(CGSize)setSize:(id)data{
    if (data) {
        
    }
    return CGSizeMake(ScreenWidth, ScreenWidth*430.0/750.0+ScreenWidth*243/1125.0+10);
}
-(void)initViews{
    //背景图片
    _imgV_up = [UIImageView new];
    _imgV_up.image = [Resources imageNamed:@"BKIntegral_UP"];
    _imgV_up.frame = CGRectMake(0, 0, ScreenWidth, ScreenWidth*477/750);
    [self addSubview:_imgV_up];
    //下半部分白色背景
    _imgV_down = [UIImageView new];
    _imgV_down.image = [Resources imageNamed:@"BKIntegral_Withe_Down"];
    _imgV_down.frame = CGRectMake(0, ScreenWidth/750*430, ScreenWidth, ScreenWidth*243/1125);
    [self addSubview:_imgV_down];
    //我的积分
    _myIntegralLabel = [UILabel new];
    _myIntegralLabel.text = @"我的积分";
    _myIntegralLabel.textAlignment = NSTextAlignmentCenter;
    if(ScreenHeight>600) {
         _myIntegralLabel.font = [Common systemFontOfSize:16];
    }else{
         _myIntegralLabel.font = [Common systemFontOfSize:14];
    }
   
    _myIntegralLabel.textColor = [UIColor whiteColor];
    [self addSubview:_myIntegralLabel];
    [_myIntegralLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).mas_offset(ApplicationBackGauge);
        make.top.equalTo(self.mas_top).mas_offset(8);
        make.height.mas_equalTo(30);
        
    }];
    //查看明细
    _ScanBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    _ScanBtn.backgroundColor = [UIColor clearColor];
    [_ScanBtn setTitle:@"查看明细 >" forState:UIControlStateNormal];
    [_ScanBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    _ScanBtn.titleLabel.font = [Common systemFontOfSize:12];
    [_ScanBtn addTarget:self action:@selector(action_look_all_IntegerList) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:_ScanBtn];
    [_ScanBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        if(ScreenHeight>600) {
           make.left.equalTo(self.myIntegralLabel.mas_right).mas_offset(8);
        }else{
           make.left.equalTo(self.myIntegralLabel.mas_right).mas_offset(0);
        }

        
        make.centerY.equalTo(self.myIntegralLabel.mas_centerY);
        make.width.mas_equalTo(80);
        make.height.mas_offset(@(30));
    }];
    //签到提醒
    _remindImageView = [UIImageView new];
    _remindImageView.image = [Resources imageNamed:@"BKIntegral_kai"];
    _remindImageView.userInteractionEnabled = YES;
    UITapGestureRecognizer *remindTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(Action_BKSignHeader_remindTap)];
    [_remindImageView addGestureRecognizer:remindTap];
    [self addSubview:_remindImageView];
    [_remindImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.mas_right).mas_offset(-ApplicationBackGauge);
        make.centerY.equalTo(_myIntegralLabel.mas_centerY);
        make.height.mas_equalTo(42/2.0);
        make.width.mas_equalTo(219/2.0);
    }];
    //中间签到圈
    _centerCicleView = [[BKCenterCicleView alloc]init];
    _centerCicleView.backgroundColor = [UIColor clearColor];
    UITapGestureRecognizer *signTap = [[UITapGestureRecognizer alloc]initWithTarget:self  action:@selector(Action_BKSignHeader_clicked_Sign)];
    [_centerCicleView addGestureRecognizer:signTap];
    [self addSubview:_centerCicleView];
    [_centerCicleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        if (ScreenWidth>370) {
            make.centerY.equalTo(self.mas_centerY).mas_offset(-(85/2.0));
        }else{
            make.centerY.equalTo(self.mas_centerY).mas_offset(-(55/2.0));
        }
        make.height.mas_equalTo(@100);
        make.width.mas_equalTo(@100);
        
    }];
    //今日还可获得10积分
    CGFloat width = 253/2;
    CGFloat height = 45/2;
    _tipImageView = [UIImageView new];
    _tipImageView.image = [Resources imageNamed:@"BKIntegral_Unsign-"];
    [self addSubview:_tipImageView];
    [_tipImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        if (ScreenWidth>375) {
            make.top.equalTo(_centerCicleView.mas_bottom).mas_offset(20);
        }else{
            make.top.equalTo(_centerCicleView.mas_bottom).mas_offset(8);
        }
        
        make.height.mas_equalTo(height);
        make.width.mas_equalTo(width);
    }];
    
    _tipLabel = [UILabel new];
    _tipLabel.text = @"加载中";
    _tipLabel.font = [UIFont systemFontOfSize:12];
    _tipLabel.textAlignment = NSTextAlignmentCenter;
    _tipLabel.textColor = [UIColor whiteColor];
    _tipLabel.backgroundColor = [UIColor clearColor];
    [_tipImageView addSubview:_tipLabel];
    [_tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.centerY.equalTo(_tipImageView.mas_centerY);
        make.left.equalTo(self.mas_left);
        make.right.equalTo(self.mas_right);
    }];
    
    
}

#pragma mark-点击【签到提醒】
-(void)Action_BKSignHeader_remindTap{
    /*
     * 本地读取   ---   是否开启本地推送
     */
    NSString *isOpen;
    isOpen = [BKIntegralCommon BK_getStringwithID:LocalRemind_KEY];
    if (isOpen) {
        if ([isOpen isEqualToString:[BKIntegralCommon getLocalKeyWithSuccess:YES]]) {
            //原来是开启状态---》关闭
            [BKIntegralCommon closeLocalNotification];
            self.remindImageView.image = ResourceImage(@"BKIntegral_kai");
        }else{
            //原来是关闭--》开启
            [self checkOpenLocalNotification];
        }
    }else{
        //没有设置过---》开启
        [self checkOpenLocalNotification];
    }
    
    
}
#pragma mark=======检测是否开启
-(void)checkOpenLocalNotification{
    if ([BKIntegralCommon isOpenLocalNotification]) {//YES
        [BKIntegralCommon openLocalNotification];
        _remindImageView.image=ResourceImage(@"BKIntegral_qiandaotixing");
    }else{
        UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"提示" message:@"开启签到提醒，赢取积分。" delegate:self cancelButtonTitle:@"取消" otherButtonTitles: @"去开启",nil];
        [alert show];
    }
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if (buttonIndex == 1) {
        NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
        if ([[UIApplication sharedApplication] canOpenURL:url]) {
            [[UIApplication sharedApplication] openURL:url];
        }
    }else{
    }
}

#pragma mark-点击【签到】
-(void)Action_BKSignHeader_clicked_Sign{

    [BKIntegralCommon checkIn_callback:^(BOOL isSucess, id obj, NSError *error) {
        if (isSucess) {
            NSDictionary * dic=(NSDictionary *)obj;
            NSString * str_integralAmount=[NSString stringWithFormat:@"%@",dic[@"integralAmount"]];
            NSString * str_tomorrowcheckIntegral=[NSString stringWithFormat:@"%@",dic[@"tomorrowcheckIntegral"]];
            //continuous_checkin_days
            NSString * str_continuous_checkin_days=[NSString stringWithFormat:@"%@",dic[@"continuous_checkin_days"]];
            [self moveBubbleToCenter];
            [self relayOutSignCicleViewWithTag:1];

            self.centerCicleView.lab_down.text = [NSString stringWithFormat:@"连续%@天",str_continuous_checkin_days];
            self.signCicle_3.imgV_bigCicle.image = [Resources imageNamed:@"BKIntegral_对勾-sign"];
            self.myIntegralLabel.text = [NSString stringWithFormat:@"我的积分:%@",str_integralAmount];
            
            self.tipLabel.text = [NSString stringWithFormat:@"明日签到可获得%@积分",str_tomorrowcheckIntegral];
          
        }
    }];
}


#pragma mark-点击【明细】
-(void)action_look_all_IntegerList{
    BKIntegralListViewController *listVC = [[BKIntegralListViewController alloc]init];
    [[self viewController].navigationController pushViewController:listVC animated:YES];

}
//得到视图控制器
- (UIViewController *)viewController {
    for (UIView* next = [self superview]; next; next = next.superview) {
        UIResponder *nextResponder = [next nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)nextResponder;
        }
    }
    return nil;
}

#pragma mark===========创建【一周签到积分圈圈】============
-(void)create_CircleS{
    CGFloat Width = (ScreenWidth-(75+20))/7.0;
    for (int i=0 ;i<7;i++) {
        CGRect rect=CGRectMake(10+i*Width+i*12.5, 13.5, Width, Width+9+12);
        if (i==0) {
            if (!_signCicle_1) {
                _signCicle_1 =[[BKCicleView alloc]init];
                [_imgV_down addSubview:_signCicle_1];
                _signCicle_1.frame=rect;
            }
        }else if(i==1){
            if (!_signCicle_2) {
                _signCicle_2 =[[BKCicleView alloc]init];
                [_imgV_down addSubview:_signCicle_2];
                _signCicle_2.frame=rect;
            }
        }else if(i==2){
            if (!_signCicle_3) {
                _signCicle_3 =[[BKCicleView alloc]init];
                _signCicle_3.imgV_down.hidden=NO;
                [_imgV_down addSubview:_signCicle_3];
                _signCicle_3.frame=rect;
            }
        }else if(i==3){
            if (!_signCicle_4) {
                _signCicle_4 =[[BKCicleView alloc]init];
                [_imgV_down addSubview:_signCicle_4];
                _signCicle_4.frame=rect;
            }
        }else if(i==4){
            if (!_signCicle_5) {
                _signCicle_5 =[[BKCicleView alloc]init];
                [_imgV_down addSubview:_signCicle_5];
                _signCicle_5.frame=rect;
            }
        }else if(i==5){
            if (!_signCicle_6) {
                _signCicle_6 =[[BKCicleView alloc]init];
                [_imgV_down addSubview:_signCicle_6];
                _signCicle_6.frame=rect;
            }
        }else if(i==6){
            if (!_signCicle_7) {
                _signCicle_7 =[[BKCicleView alloc]init];
                [_imgV_down addSubview:_signCicle_7];
                _signCicle_7.frame=rect;
            }
        }
    }
}
#pragma mark===========创建【气泡组】============
-(void)create_bubbleS{
    /*
     * 左上   (SCREEN_WIDTH/2.0-50,SC)
     */
    _cuteView_1 = [[BKBubbleView alloc]initWithPoint:[BKIntegralCommon point_bubbleWithTag:1] superView:self];
    _cuteView_1.viscosity  = 20;
    _cuteView_1.bubbleWidth = 20;
    _cuteView_1.bubbleColor = [UIColor colorWithRed:151/255.0 green:153/255.0 blue:235/255.0 alpha:0.6];
    [_cuteView_1 setUp];
    
    /*
     * 左下
     */
    _cuteView_2 = [[BKBubbleView alloc]initWithPoint:[BKIntegralCommon point_bubbleWithTag:2] superView:self];
    _cuteView_2.viscosity  = 20;
    _cuteView_2.bubbleWidth = 6;
    _cuteView_2.bubbleColor = [UIColor colorWithRed:242/255.0 green:101/255.0 blue:58/255.0 alpha:0.6];
    [_cuteView_2 setUp];
    [_cuteView_2 bubble_Random_MoveWithTag:2];
    
    /*
     * 右上
     */
    _cuteView_3 = [[BKBubbleView alloc]initWithPoint:[BKIntegralCommon point_bubbleWithTag:3] superView:self];
    _cuteView_3.viscosity  = 20;
    _cuteView_3.bubbleWidth = 15;
    _cuteView_3.bubbleColor = [UIColor colorWithRed:248/255.0 green:127/255.0 blue:43/255.0 alpha:0.6];
    [_cuteView_3 setUp];
    [_cuteView_3 bubble_Random_MoveWithTag:3];
    
    /*
     * 右下
     */
    _cuteView_4 = [[BKBubbleView alloc]initWithPoint:[BKIntegralCommon point_bubbleWithTag:4] superView:self];
    _cuteView_4.viscosity  = 20;
    _cuteView_4.bubbleWidth = 10;
    _cuteView_4.bubbleColor = [UIColor colorWithRed:114/255.0 green:160/255.0 blue:248/255.0 alpha:0.6];
    [_cuteView_4 setUp];
    [_cuteView_4 bubble_Random_MoveWithTag:4];
}
-(void)relayOutUI:(id)data{
    if (!data) {
        return;
    }
    
    BKintegralModel *model = [[BKintegralModel alloc]init];
    model.continuous_checkin_days = [NSString stringWithFormat:@"%@",[data objectForKey:@"continuous_checkin_days"]];
    model.integralAmount = [NSString stringWithFormat:@"%@",[data objectForKey:@"integralAmount"]];
    model.is_checked = [NSString stringWithFormat:@"%@",[data objectForKey:@"is_checked"]];
    model.todaycheckIntegral = [NSString stringWithFormat:@"%@",[data objectForKey:@"todaycheckIntegral"]];
    
    self.resultArr  = [[NSMutableArray alloc]init];
    NSMutableArray *arrayList = [[data objectForKey:@"sevenDaysCheckInfo"] mutableCopy];
    for (NSDictionary *dic in arrayList) {
        BKSignDayModel *signDayModel = [[BKSignDayModel alloc]init];
        signDayModel.day = [NSString stringWithFormat:@"%@",[dic objectForKey:@"day"]];
        signDayModel.checkintegral = [NSString stringWithFormat:@"%@",dic[@"checkintegral"]];
        signDayModel.is_checked = [NSString stringWithFormat:@"%@",dic[@"is_checked"]];
        [self.resultArr addObject:signDayModel];
    }
    
    NSString *flag = [BKIntegralCommon BK_getStringwithID:@"LocalRemind_KEY"];
    if (flag) {
        if ([flag isEqualToString:[NSString stringWithFormat:@"Open_LocalRemind%@",[BKIntegralCommon getUserId]]]) {
            _remindImageView.image = [Resources imageNamed:@"BKIntegral_qiandaotixing"];
        }else{
            _remindImageView.image = [Resources imageNamed:@"BKIntegral_kai"];
        }
    }else{
        _remindImageView.image = [Resources imageNamed:@"BKIntegral_kai"];
    }
    if (model) {
        _myIntegralLabel.text = [NSString stringWithFormat:@"我的积分:%@",model.integralAmount];
        _centerCicleView.lab_down.text = [NSString stringWithFormat:@"连续%@天",model.continuous_checkin_days];
        if ([model.is_checked isEqualToString:@"0"]) {//0未签
            _centerCicleView.userInteractionEnabled = YES;
            [self relayOutSign_tipWithTag:0 andModel:model orCheckintegral:nil];
            [self relayOutNo_animationSignCicleViewWithTag:0];
        }else if([model.is_checked isEqualToString:@"1"]){//1已签
            _centerCicleView.userInteractionEnabled = NO;
            [self dismiss_Bubble];
            [self relayOutSign_tipWithTag:1 andModel:model orCheckintegral:nil];
            [self relayOutNo_animationSignCicleViewWithTag:1];
        }
        
        
        NSString * str_imgV_Name_big;
        int i=0;
        for (BKSignDayModel * dayModel in self.resultArr) {
            
            i++;
            if (i<3) {
                if ([dayModel.is_checked isEqualToString:@"0"]) {//未签到
                    str_imgV_Name_big=@"BKIntegral_失败";
                }else{//已经签过的
                    if ([dayModel.checkintegral isEqualToString:@"5"]){
                        str_imgV_Name_big=@"Sign+5";
                    }else if([dayModel.checkintegral isEqualToString:@"6"]){
                        str_imgV_Name_big=@"Sign+6";
                    }else if([dayModel.checkintegral isEqualToString:@"7"]){
                        str_imgV_Name_big=@"Sign+7";
                    }else if([dayModel.checkintegral isEqualToString:@"8"]){
                        str_imgV_Name_big=@"Sign+8";
                    }else if([dayModel.checkintegral isEqualToString:@"10"]){
                        str_imgV_Name_big=@"Sign+10";
                    }else if([dayModel.checkintegral isEqualToString:@"12"]){
                        str_imgV_Name_big=@"Sign+12";
                    }else if([dayModel.checkintegral isEqualToString:@"15"]){
                        str_imgV_Name_big=@"Sign+15";
                    }
                }
            }else if (i==3){
                if ([dayModel.is_checked isEqualToString:@"0"]) {
                    str_imgV_Name_big=@"BKIntegral_羽毛";
                }else if([dayModel.is_checked isEqualToString:@"1"]){
                    str_imgV_Name_big=@"BKIntegral_对勾-sign";
                }
            }else{
                if ([dayModel.checkintegral isEqualToString:@"5"]){
                    str_imgV_Name_big=@"NOSign+5";
                }else if([dayModel.checkintegral isEqualToString:@"6"]){
                    str_imgV_Name_big=@"NOSign+6";
                }else if([dayModel.checkintegral isEqualToString:@"7"]){
                    str_imgV_Name_big=@"NOSign+7";
                }else if([dayModel.checkintegral isEqualToString:@"8"]){
                    str_imgV_Name_big=@"NOSign+8";
                }else if([dayModel.checkintegral isEqualToString:@"10"]){
                    str_imgV_Name_big=@"NOSign+10";
                }else if([dayModel.checkintegral isEqualToString:@"12"]){
                    str_imgV_Name_big=@"NOSign+12";
                }else if([dayModel.checkintegral isEqualToString:@"15"]){
                    str_imgV_Name_big=@"NOSign+15";
                }
            }
            
            if (i==1) {
                _signCicle_1.imgV_bigCicle.image=[UIImage imageNamed:str_imgV_Name_big];
                NSLog(@"%@",dayModel.day);
                _signCicle_1.lab_down.text=dayModel.day;
            }else if(i==2){
                _signCicle_2.imgV_bigCicle.image=[UIImage imageNamed:str_imgV_Name_big];
                _signCicle_2.lab_down.text=dayModel.day;
            }else if(i==3){
                _signCicle_3.imgV_bigCicle.image=[UIImage imageNamed:str_imgV_Name_big];
            }else if(i==4){
                _signCicle_4.imgV_bigCicle.image=[UIImage imageNamed:str_imgV_Name_big];
                _signCicle_4.lab_down.text=dayModel.day;
            }else if(i==5){
                _signCicle_5.imgV_bigCicle.image=[UIImage imageNamed:str_imgV_Name_big];
                _signCicle_5.lab_down.text=dayModel.day;
            }else if(i==6){
                _signCicle_6.imgV_bigCicle.image=[UIImage imageNamed:str_imgV_Name_big];
                _signCicle_6.lab_down.text=dayModel.day;
            }else if(i==7){
                _signCicle_7.imgV_bigCicle.image=[UIImage imageNamed:str_imgV_Name_big];
                _signCicle_7.lab_down.text=dayModel.day;
            }
        }
        
    }
    
}
#pragma  将气泡移动到中心
-(void)moveBubbleToCenter{
    [_cuteView_1 dismiss_BubbleWithTag:1];
    [_cuteView_2 dismiss_BubbleWithTag:2];
    [_cuteView_3 dismiss_BubbleWithTag:3];
    [_cuteView_4 dismiss_BubbleWithTag:4];
    [self performSelector:@selector(dismiss_Bubble) withObject:nil afterDelay:0.6f];
}
#pragma -干掉气泡
-(void)dismiss_Bubble{
    _cuteView_2.alpha=0;
    _cuteView_1.alpha=0;
    _cuteView_3.alpha=0;
    _cuteView_4.alpha=0;
    _cuteView_2.frontView.hidden=YES;
    _cuteView_1.frontView.hidden=YES;
    _cuteView_3.frontView.hidden=YES;
    _cuteView_4.frontView.hidden=YES;
    [_cuteView_2  removeFromSuperview];
    [_cuteView_1  removeFromSuperview];
    [_cuteView_3  removeFromSuperview];
    [_cuteView_4  removeFromSuperview];
}

#pragma mark-刷新【Sign_tip】模块
-(void)relayOutSign_tipWithTag:(int)tag andModel:(BKintegralModel *)model orCheckintegral:(NSString *)checkintegral{
    BKSignDayModel * DayModel=[self.resultArr objectAtIndex:3];
    if (tag==1) {//已签到
        if (checkintegral) {
            _tipLabel.text=[NSString stringWithFormat:@"明日签到可获%@积分",checkintegral];
        }else{
            _tipLabel.text=[NSString stringWithFormat:@"明日签到可获%@积分",DayModel.checkintegral];
        }
        _tipImageView.image=[UIImage imageNamed:@"BKIntegral_Unsign-"];
    }else{
        _tipLabel.text=[NSString stringWithFormat:@"今日签到可获%@积分",model.todaycheckIntegral];
        _tipImageView.image=[UIImage imageNamed:@"BKIntegral_NOsign-"];
    }
}
#pragma mark-刷新【签到圈圈】模块有动画
-(void)relayOutSignCicleViewWithTag:(int)tag{
   
    if (tag==1) {//已签到  //白色
         _centerCicleView.view_line.backgroundColor=[UIColor whiteColor];
        [UIView transitionWithView:_centerCicleView duration:1 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{
            
            _centerCicleView.imgV_Sign.image=[UIImage imageNamed:@"BKIntegral_didSign"];
            _centerCicleView.userInteractionEnabled=NO;
            _centerCicleView.lab_down.textColor=[UIColor whiteColor];
            _centerCicleView.lab_up.text=@"已签到";
            _centerCicleView.lab_up.textColor=[UIColor whiteColor];
            
        } completion:^(BOOL finished) {
            
        }];
        
    }else{
        //没有签到  //RGB(246, 143, 56)
        _centerCicleView.userInteractionEnabled=YES;
        _centerCicleView.lab_up.text=@"签到";
        _centerCicleView.lab_down.textColor=RGBACOLOR(246, 143, 56, 1);
        _centerCicleView.lab_up.textColor=RGBACOLOR(246, 143, 56, 1);
        _centerCicleView.view_line.backgroundColor=RGBACOLOR(246, 143, 56, 1);
    }
}
#pragma mark  -----无动画-------
-(void)relayOutNo_animationSignCicleViewWithTag:(int)tag{
    
    if (tag==1) {//已签到  //白色
            _centerCicleView.view_line.backgroundColor=[UIColor whiteColor];
            _centerCicleView.imgV_Sign.image=[UIImage imageNamed:@"BKIntegral_didSign"];
            _centerCicleView.userInteractionEnabled=NO;
            _centerCicleView.lab_down.textColor=[UIColor whiteColor];
            _centerCicleView.lab_up.text=@"已签到";
            _centerCicleView.lab_up.textColor=[UIColor whiteColor];
            
        
        
    }else{
        //没有签到  //RGB(246, 143, 56)
        _centerCicleView.userInteractionEnabled=YES;
        _centerCicleView.lab_up.text=@"签到";
        _centerCicleView.lab_down.textColor=RGBACOLOR(246, 143, 56, 1);
        _centerCicleView.lab_up.textColor=RGBACOLOR(246, 143, 56, 1);
        _centerCicleView.view_line.backgroundColor=RGBACOLOR(246, 143, 56, 1);
    }
}


@end
